home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / snippet.exe / UCLOCK.H < prev    next >
C/C++ Source or Header  |  1991-09-15  |  1KB  |  54 lines

  1. /*
  2. **  UCLOCK.H
  3. **
  4. **  Original Copyright 1988-1991 by Bob Stout as part of
  5. **  the MicroFirm Function Library (MFL)
  6. **
  7. **  This subset version is functionally identical to the
  8. **  version originally published by the author in Tech Specialist
  9. **  magazine and is hereby donated to the public domain.
  10. */
  11.  
  12. #include <dos.h>
  13. #include <time.h>
  14.  
  15. #if defined(__ZTC__)
  16.  #include <int.h>
  17.  #undef int_on
  18.  #undef int_off
  19. #elif defined(__TURBOC__)
  20.  #define int_on         enable
  21.  #define int_off        disable
  22.  #ifndef inp
  23.   #define inp           inportb
  24.  #endif
  25.  #ifndef outp
  26.   #define outp          outportb
  27.  #endif
  28. #else /* assume MSC/QC */
  29.  #include <conio.h>
  30.  #define int_on         _enable
  31.  #define int_off        _disable
  32.  #ifndef MK_FP
  33.   #define MK_FP(seg,offset) \
  34.         ((void far *)(((unsigned long)(seg)<<16) | (unsigned)(offset)))
  35.  #endif
  36. #endif
  37.  
  38. /* ANSI-equivalent declarations and prototypes */
  39.  
  40. typedef unsigned long uclock_t;
  41.  
  42. #define UCLK_TCK 1000000L /* Usec per second - replaces CLK_TCK         */
  43.  
  44. #if __cplusplus
  45.  extern "C" {
  46. #endif
  47.  
  48. uclock_t usec_clock(void);
  49. void     restart_uclock(void);
  50.  
  51. #if __cplusplus
  52.  }
  53. #endif
  54.